package de.matusystems


import org.springframework.mail.MailSendException;

class EmailService {

	def mailService

	def send(String mailTo, String mailSubject, String mailBody) {

		log.debug("sending email to "+mailTo+" ...")
		try{
			mailService.sendMail {
				to mailTo
				subject mailSubject
				html mailBody
			}
		}catch(MailSendException e){
			log.error("Failed to send mail")
			return false
		}
		log.debug("email send.")
		return true
	}
}
